package Server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;

public class server {
    public static final Map<Socket,String>map = new HashMap<>();

    public static void main(String[] args) {
        System.out.println("服务器启动");
        try {
            ServerSocket serverSocket = new ServerSocket(Constant.PORT);
            while (true) {
                System.out.println("等待连接");
                Socket socket = serverSocket.accept();
                new Thread(new Mythread(socket)).start();
                System.out.println("连接成功");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
